using System;
using System.Collections.Generic;
using UnityEngine;

[Serializable]
public class terrain_region_class
{
	public bool active;

	public bool foldout;

	public string text;

	public List<terrain_area_class> area;

	public int area_select;

	public int mode;

	public Rect area_size;

	public terrain_region_class()
	{
		active = true;
		foldout = true;
		text = "Terrain Area";
		area = new List<terrain_area_class>();
		area.Add(new terrain_area_class());
	}

	public void add_area(int index)
	{
		area.Insert(index, new terrain_area_class());
		set_area_index();
		set_area_text();
		area[index].set_terrain_text();
		area[index].path = Application.dataPath;
	}

	public void erase_area(int index)
	{
		area.RemoveAt(index);
		set_area_index();
		set_area_text();
	}

	public void set_area_index()
	{
		for (int i = 0; i < area.Count; i++)
		{
			area[i].index = i;
		}
	}

	public void set_area_text()
	{
		if (area.Count > 1)
		{
			text = "Terrain Areas";
		}
		else
		{
			text = "Terrain Area";
		}
	}
}
